<?php

function validate($id_stok_logk) {
    include 'connect.php';
    $query = mysqli_query($con, "SELECT `id_stok_logk`, `id_bhp`, `id_unitkerja`, `jumlah`, `tanggal` 
             FROM `STOK_LOG_KURANG` WHERE `id_stok_logk` = '$id_stok_logk'");
    $data = mysqli_fetch_array($query);
    $query2 = mysqli_query($con, "INSERT INTO `STOK_LOG_TAMBAH` 
            (`id_stok_logt`, `id_bhp`, `id_unitkerja`, `jumlah`, `tanggal`)
            VALUES ('$data[0]','$data[1]','$data[2]',$data[3],'$data[4]');");
    echo "INSERT INTO `STOK_LOG_TAMBAH` 
        (`id_stok_logt`, `id_bhp`, `id_unitkerja`, `jumlah`, `tanggal`)
        VALUES ('$data[0]','$data[1]','$data[2]',$data[3],'$data[4]');";
}
?>